<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateOrdersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        //
        Schema::create('orders', function (Blueprint $table) {
            $table->increments('id');
            $table->string('oid') -> comment('订单号');
            $table->integer('uid') -> comment('用户ID');
            // $table->integer('gid') -> comment('商品ID');
            // $table->integer('scnt') -> comment('购买数量');
            $table->integer('addrid') ->default(1) -> comment('收货地址ID');
            // $table->integer('colorid') ->default(1)  -> comment('颜色ID');
            // $table->integer('memoryid') ->default(1) -> comment('内存ID');
            $table->smallInteger('status') ->default(0) -> comment('状态,0未付款,1已付款未发货,2未收货,3已收货,4交易完成');
            // $table->string('addtime') -> comment('下单时间');
            $table->timestamps();
            });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        //
        Schema::drop('orders');
    }
}
